import Vue from 'vue'
import VueRouter from 'vue-router'
import LoginView from '../views/LoginView'
import Register from "@/components/register/Register";

Vue.use(VueRouter)

const routes = [{
    path: '/',
    redirect: '/login'
},
    {
        path: '/login',
        name: 'login',
        component: LoginView
    }, {
        path: '/register',
        name: 'Register',
        component: Register,
    },
    {
        path: '/registerMessage',
        name: 'registerMessage',
        component: () =>
            import ('../components/register/RegisterMessage')
    },
    {
        path: '/firstMenu',
        name: 'firstMenu',
        component: () =>
            import ('../views/FirstMenuView.vue'),
        children: [{
            path: '/frontPage',
            name: 'frontPage',
            component: () =>
                import ('../views/FrontPageView.vue')
        },
            {
                path: '/bindDoctor',
                name: 'bindDoctor',
                component: () => import('../components/frontPage/BindDoctor')
            }, {
                path: '/adverseReactions',
                name: 'adverseReactions',
                component: () =>
                    import ('../components/frontPage/AdverseReactions.vue'),
            }, {
                path: '/medicalHistory',
                name: 'medicalHistory',
                component: () =>
                    import ('../views/MedicalHistoryView.vue')

            }, {
                path: '/completecase',
                name: 'Completecase',
                component: () =>
                    import ('../components/medicalHistory/Completecase.vue')
            }, {
                path: '/record',
                name: 'record',
                component: () =>
                    import ('../components/medicalHistory/YuPeiYang/Record.vue')
            }, {
                path: '/information',
                name: 'information',
                component: () =>
                    import ('../views/InformationView.vue')
            }, {
                path: '/my',
                name: 'my',
                component: () =>
                    import ('../views/MyView.vue'),

            }, {
                path: '/mymessage',
                name: 'mymessage',
                component: () =>
                    import ('../components/my/MyMessage.vue')
            },
            {
                path: '/myillnesslog',
                name: 'myillnesslog',
                component: () =>
                    import ('../components/my/MyIllnessLog.vue')
            },
            {
                path: '/mydoctor',
                name: 'mydoctor',
                component: () =>
                    import ('../components/my/MyDoctor.vue')
            },
            {
                path: '/setting',
                name: 'setting',
                component: () =>
                    import ('../components/my/Setting.vue')
            },
            {
                path: '/infosetting',
                name: 'infosetting',
                component: () =>
                    import ('../components/my/InfoSetting.vue')
            },
            {
                path: '/mymessagesetting',
                name: 'mymessagesetting',
                component: () =>
                    import ('../components/my/MyMessageSetting.vue')
            },
            {
                path: '/myversion',
                name: 'myversion',
                component: () =>
                    import ('../components/my/MyVersion.vue')
            },
            {
                path: '/shareapp',
                name: 'shareapp',
                component: () =>
                    import ('../components/my/ShareApp.vue')
            },
            {
                path: '/updatepassword',
                name: 'updatepassword',
                component: () =>
                    import ('../components/my/UpdatePassword.vue')
            },
            {
                path: '/sanfangconnect',
                name: 'sanfangconnect',
                component: () =>
                    import ('../components/my/SanFangConnect.vue')
            },
            {
                path: '/weibo',
                name: 'weibo',
                component: () =>
                    import ('../components/my/Weibo.vue')
            },
            {
                path: '/qq',
                name: 'qq',
                component: () =>
                    import ('../components/my/QQ.vue')
            },
            {
                path: '/weixin',
                name: 'weixinqq',
                component: () =>
                    import ('../components/my/Weixin.vue')
            },
            {
                path: '/log',
                name: 'log',
                component: () =>
                    import ('../components/my/Log.vue')
            },
            {
                path: '/writelog',
                name: 'writelog',
                component: () =>
                    import ('../components/my/WriteLog.vue')
            },
            {
                path: '/myinfor',
                name: 'myinfor',
                component: () =>
                    import ('../components/my/MyInfor.vue')
            },
            {
                path: '/mingxi',
                name: 'mingxi',
                component: () =>
                    import ('../components/my/Mingxi.vue')
            },
            {
                path: '/paymoney',
                name: 'paymoney',
                component: () =>
                    import ('../components/my/PayMoney.vue')
            },
            {
                path: '/updatemyinfor',
                name: 'updatemyinfor',
                component: () =>
                    import ('../components/my/UpdateMyInfor.vue')
            },
            {
                path: '/chakandoctor',
                name: 'chakandoctor',
                component: () =>
                    import ('../components/my/ChaKanDoctor.vue')
            },
            {
                path: '/explain',
                name: 'explain',
                component: () =>
                    import ('../components/my/Explain.vue')
            }, {//余沛洋的router
                path: '/yupeiyang',
                name: 'yupeiyang',
                component: () =>
                    import ('../views/YuPeiYang.vue'),
            }, {
                path: '/recordvisit',
                name: 'recordvisit',
                component: () =>
                    import ('../components/medicalHistory/YuPeiYang/RecordVisit.vue'),
            }, {
                path: '/record',
                name: 'record',
                component: () =>
                    import ('../components/medicalHistory/YuPeiYang/Record.vue'),
            }, {
                path: '/chooseDrug',
                name: 'chooseDrug',
                component: () =>
                    import ('../components/medicalHistory/ChooseDrug.vue'),
            },


        ]
    }
]

const router = new VueRouter({
    routes
})

export default router
